import request from '@/utils/request'

export const getTree = async (type) => {
    const res = await request({
        url: `/harbour/tree/${type}`,
        method: 'get',
    })
    return res
}
export const getTreeNode = async (pid) => {
    const res = await request({
        url: `/harbour/list/${pid}/0`,
        method: 'get',
    })
    return res
}
export const getHarborPrefix = async (prefix) => {
    const res = await request({
        url: `/harbour/harbourPrefix?prefix=${prefix}`,
        method: 'get',
    })
    return res
}
export const delTree = async (id) => {
    const res = await request({
        url: `/harbour/del/${id}`,
        method: 'get',
    })
    return res
}
export const saveTree = async (data) => {
    const res = await request({
        url: `/harbour/save`,
        method: 'post',
        data,
    })
    return res
}
export const switchTree = async (data) => {
    const res = await request({
        url: `/harbour/itemOrder`,
        method: 'post',
        data,
    })
    return res
}
